package club.looli.haoke.api.controller;

import club.looli.haoke.api.service.PicUploadFileSystemService;
import club.looli.haoke.api.service.PicUploadService;
import club.looli.haoke.api.vo.PicUploadResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 * Created by looli on 2020/7/8
 * </p>
 *
 * <p>
 *  文件上传controller
 * </p>
 *
 * @author looli
 * @since 2020/7/8
 */
@RestController
@RequestMapping("pic/upload")
public class PicUploadController {

//    @Autowired
//    private PicUploadService picUploadService;

    @Autowired
    private PicUploadFileSystemService picUploadService;

    @RequestMapping
    public PicUploadResult upload(@RequestParam("file") MultipartFile uploadFile){
        return picUploadService.upload(uploadFile);
    }

}
